package com.itheima.studenthomework.dao;

import com.itheima.studenthomework.domain.User;

import java.util.ArrayList;

public class UserDao {
    private static ArrayList<User> list = new ArrayList<>();
    public ArrayList<User> giveList() {
        return list;
    }

    public boolean addUser(User user) {
        list.add(user);
        return true;
    }

    public boolean verifyUser(int index, String password) {
        User user = list.get(index);
        if(password.equals(user.getPassword())){
            return true;
        }else {
            return false;
        }
    }
}
